module AboutYou
  module SDK
    module Model
      ###
      # This class is used as a model for a categories result
      ###
      class CategoriesResult
        # Array containing instances of AboutYou::SDK::Model::Category
        attr_accessor :categories
        # Array containing the categories which are not found
        attr_accessor :categories_not_found
        # the ids of the categories in this result
        attr_accessor :ids

        ###
        # Constructor for the AboutYou::SDK::Model::CategoriesResult class
        #
        # * *Args*    :
        #   - +category_manager+ -> instance of AboutYou::SDK::Model::CategoryManager::DefaultCategoryManager
        #   - +ids+ -> the ids of the categories in this result
        #
        # * *Returns* :
        #   - an instance of AboutYou::SDK::Model::CategoriesResult
        ###
        def initialize(category_manager, ids)
          self.ids = ids
          self.categories = category_manager.categories(
            ids,
            AboutYou::SDK::Model::Category::ALL
          )
        end
      end
    end
  end
end
